package com.example.administrator.managesystem.view;

import android.app.Dialog;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.example.administrator.managesystem.R;
import com.makeramen.roundedimageview.RoundedImageView;
import com.zhy.view.flowlayout.TagFlowLayout;

public class UpdateGoodsDialog extends Dialog {

    private Button button_cancel, button_send;//定义取消与确认按钮
    private EditText goods_price,goods_storage;//定义标题文字


    //构造方法
    public UpdateGoodsDialog(Context context) {

        //设置对话框样式
        super(context, R.style.mdialog);
        //通过LayoutInflater获取布局
        final View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_update_goods, null);
        goods_price = view.findViewById(R.id.goods_price);   //获取显示标题的文本框控件
        goods_storage = view.findViewById(R.id.goods_storage);   //获取显示标题的文本框控件
        button_cancel = view.findViewById(R.id.btn_cancel);    //获取取消按钮
        button_send = view.findViewById(R.id.btn_send);  //获取确认退出按钮

        setContentView(view);  //设置显示的视图


        button_send.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                enterListener.onEnterClick(view,goods_price,goods_storage);
            }
        });

    }

    //取消监听
    public void setOnCancelListener(View.OnClickListener listener) {
        button_cancel.setOnClickListener(listener);
    }

    //点击三角
    private OnEnterClickListener enterListener;
    public interface OnEnterClickListener {
        void onEnterClick( View view,EditText price,EditText number);
    }
    public void setOnEnterClickListener (OnEnterClickListener listener) {
        enterListener=listener;
    }


}
